package com.codeplex.tdmg4mc;

import org.lwjgl.input.Keyboard;

public class Key
{
	private int key;
	private boolean shift;
	private boolean ctrl;
	private boolean alt;
	public Key(String Key)
	{
		this(Key, false, false, false);
	}
	public Key(int Key)
	{
		this(Key, false, false, false);
	}
	public Key(String Key, boolean Shift, boolean Ctrl, boolean Alt)
	{
		this(Keyboard.getKeyIndex(Key), Shift, Ctrl, Alt);
	}
	public Key(int Key, boolean Shift, boolean Ctrl, boolean Alt)
	{
		key=Key;
		shift=Shift||key==Keyboard.KEY_LSHIFT||key==Keyboard.KEY_RSHIFT;
		ctrl=Ctrl||key==Keyboard.KEY_LCONTROL||key==Keyboard.KEY_RCONTROL;
		alt=Alt||key==Keyboard.KEY_LMENU||key==Keyboard.KEY_RMENU;
	}
	public int getKey()
	{
		return key;
	}
	public boolean getShift()
	{
		return shift;
	}
	public boolean getCtrl()
	{
		return ctrl;
	}
	public boolean getAlt()
	{
		return alt;
	}
	public boolean modifierEqual(boolean s, boolean c, boolean a)
	{
		return s==shift&&c==ctrl&&a==alt;
	}
}